<template>
  <div>
    <h1>展示的内容:{{ count }}</h1>
    <input type="text" v-model="num" value="num" @keyup.enter="fn" />
    <hr />
    <input type="file" @change="imgurl" />
    <img :src="file" alt="" width="200px" height="200px" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      count: '',
      num: '',
      file: '',
    }
  },
  methods: {
    fn(e) {
      console.log(e)
      this.count = this.num
      this.num = ''
    },
    imgurl(e) {
      // console.log(e)
      const imgfile = e.target.files[0]
      this.file = URL.createObjectURL(imgfile)
    },
  },
}
</script>

<style></style>
